/**
 * 
 * 
 * Created on 30 apr. 2011 @ 15:22:12 by Laurens Andriessen
 */

package tests.laurens.cajomulticasting;

import gnu.cajo.utils.Multicast;


/**
 * 
 * @author Laurens Andriessen
 * @version 1.0
 */
public class MultiCastServer {

	static Object object = new MultiCastServer();

	public String doit(String message) { // remotely callable method
		System.out.println("Doing it " + message);
		synchronized (this) {
			notify();
		} // end program
		return "Didit!";
	}

	public static void main(String args[]) throws Exception { // unit test
		Multicast m = new Multicast();
		m.announce(object, 3); // broadcast reference short distance
		synchronized (object) {
			object.wait();
		}
		System.exit(0);
	}
}
